<template>
  <BasicTable
    title=""
    :columns="columns"
    :dataSource="data"
    :loading="loading"
    striped
    bordered
    showTableSetting
    :pagination="pagination"
    :resizeHeightOffset="33"
  >
    <template #bodyCell="{ column, record }">
      <template v-if="column.key === 'action'">
        <span class="">
          <a>导出</a>
          <a class="ml-4">详细</a>
        </span>
      </template>
    </template>

    <template #toolbar>
      <a-button type="primary" ghost @click="$emit('on-setup')"> 模板设置 </a-button>
      <a-button type="primary" ghost @click="$emit('on-manual')"> 手动报表 </a-button>
    </template>
  </BasicTable>
</template>
  <script lang="ts">
import { defineComponent, ref } from 'vue';
import { BasicTable } from '/@/components/Table';
import { getCols, getRows } from './tableData';

export default defineComponent({
  components: { BasicTable },
  setup() {
    const loading = ref(false);
    const pagination = ref<any>(true);

    return {
      columns: getCols(),
      data: getRows(),
      loading,
      pagination,
    };
  },
});
</script>
